package org.unit.testmgmt.generator.wizard;

import org.unit.testmgmt.tml.ObjectFactory;
import org.unit.testmgmt.tml.UTMModel;
import org.unit.testmgmt.ui.generator.wizard.GeneratorWizardBasePage;

/**
 * The controller for the base page.
 * 
 * @author Robert Streng
 *
 */
public abstract class GeneratorWizardBase {

	private GeneratorWizardBasePage generatorWizardPage;
	private UTMModel model;
	private ObjectFactory of = new ObjectFactory();

	/**
	 * @param model
	 * @param generatorWizardPageBase
	 */
	public GeneratorWizardBase(UTMModel model,
			GeneratorWizardBasePage generatorWizardPageBase) {
		this.model = model;
		this.generatorWizardPage = generatorWizardPageBase;
	}

	/**
	 * Returns the Page.
	 * 
	 * @return the page
	 */
	protected GeneratorWizardBasePage getPage() {
		return generatorWizardPage;
	}
	
	/**
	 * Returns the unit-testmgmt-Model with all test data.
	 * 
	 * @return the UTM-model
	 */
	protected UTMModel getModel() {
		return model;
	}

	/**
	 * Returns the object factory for the TML-elements.
	 * 
	 * @return the object factory
	 */
	public ObjectFactory getObjectFactory() {
		return of;
	}

	/**
	 * Sets the object factory.
	 * 
	 * @param of
	 */
	public void setObjectFactory(ObjectFactory of) {
		this.of = of;
	}
	
	/**
	 * Initializes the page
	 */
	public abstract void initPage();
	
	/**
	 * Updates the UTM-model.
	 */
	public abstract void updateModel();
	
}
